import { IFeidaoAiMobile } from '@dfeidao/atom-mobile/interfaces';
import local_get from '@dfeidao/atom-mobile/local/get';
import action_sheet from '@dfeidao/atom-mobile/msgbox/action-sheet';
import goto from '@dfeidao/atom-mobile/nav/goto';
export default async function a002(fd: IFeidaoAiMobile, e: Event) {
	const teacher_no = await local_get(fd, 'teacher_no');
	const teacher_name = await local_get(fd, 'teacher_name');

	let BUTTONS = new Array();
	BUTTONS = ["发布全班作业", "发布个人作业", "取消"];

	const index = await action_sheet({
		options: BUTTONS,
		cancelButtonIndex: 2,
		destructiveButtonIndex: 2,
		title: '请选择'
	});

	// 按上面数组索引判断
	if (index === 0) {
		// 发布全班作业
		goto(fd, 'app_class_work', { teacher_no, teacher_name });
	}
	if (index === 1) {
		// 发布个人作业
		goto(fd, 'app_personal_work', { teacher_no, teacher_name });
	}

}
